#include "constantManager.h"

ConstantManager manager;


ConstantManager::ConstantManager()
	:m_resourcePath(DEFAULT_RES_PATH)
	,m_qWinTitle(EDITOR_WINDOW_TITLE)
	,m_saved(true)
{
}

void ConstantManager::setMainWindow( MainWindow *wid )
{
	m_qWindow = wid;
}

MainWindow * ConstantManager::qWindow()
{
	return m_qWindow;
}

ConstantManager * ConstantManager::sharedManager()
{
	return &manager;
}

void ConstantManager::setSaved(bool bol)
{
	QString title;
	if (!bol )
	{
		title = m_qWinTitle +" - " + m_currentProjFile +" *";
	}else
	{
		title =  m_qWinTitle +" - " + m_currentProjFile ;
	}
	m_qWindow->setWindowTitle(title);
    this->m_saved = bol;
}

bool ConstantManager::getSaved()
{
	return m_saved;
}

void ConstantManager::setCurrentProjPath( QString filename )
{
	m_qWindow->setWindowTitle(m_qWinTitle +" - " + filename  );
	m_currentProjFile = filename;
}

QString ConstantManager::getCurrentProjPath()
{
	return m_currentProjFile;
}
